<!-- 批次库存查询 - 综合表单页面 -->
<template>
  <div class="page-container">
    <ex_super_table_page v-bind="option" ref="SuperTablePage">
    </ex_super_table_page>
    <el-dialog :title="$tt('label_stock_detail')" :visible.sync="dialogVisible" width="1100px">
      <ex_super_table class="el-table-nowwarp" ref="resourceDownloadGridPanelEl"
        :url="'/wms-api/stock/StockQueryRpc/stockContainerQuery.json?batchId=' + chooseRowId"
        :attrs="{ autoPage: true, autoLoad: true }" height="400" v-bind="tableOption">
      </ex_super_table>
      <span slot="footer" class="dialog_footer">
        <el-button @click="dialogVisible = false">{{ $tt('label_close') }}</el-button>
      </span>
    </el-dialog>

  </div>
</template>
<script>

import superTablePageFunction from '@/mixin/super-table-page-function';

export default {
  title: 'title_stock_batch_query',
  mixins: [superTablePageFunction],
  components: {},
  data() {
    return {

      dialogVisible: false,

      chooseRowId: 0,

      option: {
        //搜索框内容
        search: {
          //搜索框内容，key为搜索字段，label为标签提示
          model: [

            { label: "label_customer", key: "customerId", type: 'common_customer_choose', },
            { label: "label_sku", key: "skuId", type: 'sku_selec_input', },
            {
              key: 'batchNo', label: 'label_batch_code'
            },
            {label: "label_business_type", key: "bizType", type: 'select', enum: 'BizTypeEnum'},

          ],
        },
        action: [
        ],

        table: {
          url: "/wms-api/stock/StockQueryRpc/stockBatchQuery.json",
          attrs: {},
          model: [
            {
              key: 'batchNo', label: 'label_batch_code',align:'left' ,
            },
            {
              key: 'customerCode', label: 'label_srm_api_request_customer_code',align:'left' ,
            },
            {
              key: 'customerName', label: 'label_customer_name',align:'left' ,
            },
            // {
            //   key: 'warehouseId', label: '仓库id',
            // },
            {
              key: 'skuOnlyCode', label: 'label_sku_only_code',align:'left' ,
              attrs: {
                formatter: (r, c, v, i) => r.skuId < 0 ? "-" : v
              }
            },
            // {
            //   key: 'skuBarcode', label: '商品条形编码（英文字母需要统一转大写)',
            // },
            {
              key: 'skuName', label: 'label_sku_name_cn',align:'left' ,
              attrs: {
                formatter: (r, c, v, i) => r.skuId < 0 ? "-" : v
              }
            },
            {
              key: 'skuNameEn', label: 'label_sku_name_en', align:'left' ,
              attrs: {
                formatter: (r, c, v, i) => r.skuId < 0 ? "-" : v
              }
            },
            {
              key: 'bizType', label: 'label_business_type', 'width': 120, 'show-overflow-tooltip': true, align:'right' ,
              formatter: (r, c, v, i) => this.$enumShow(v, "BizTypeEnum")
            },
            {
              key: 'freezeQty', label: 'label_frozen_count',align:'right' ,
            },
            {
              key: 'lockQty', label: 'label_lock_count',align:'right' ,
            },
            {
              key: 'usableQty', label: 'label_usable_count',align:'right' ,
            },
            {
              key: 'totalQty', label: 'label_sum',align:'right' ,
            },
            {
              type: 'operate', width: 160, operate: [

                {
                  label: 'label_view_detail', click: (row) => {
                    this.chooseRowId = row.id
                    this.dialogVisible = true
                  }
                }

              ],
            }
          ],

        }
        ,

      },
      tableOption: {
        model: [
          { key: 'locationCode', label: 'label_warehouse_location_code', 'min-width': 140, 'show-overflow-tooltip': true, },
          { key: 'subContainerCode', label: 'label_container_code', 'min-width': 140, 'show-overflow-tooltip': true, },
          {
            key: 'bizType', label: 'label_business_type', 'width': 120, 'show-overflow-tooltip': true,
            formatter: (r, c, v, i) => this.$enumShow(v, "BizTypeEnum")
          },
          { key: 'isTmpLocation', label: 'label_staging_area', 'width': 120, 'show-overflow-tooltip': true, },
          { key: 'stockKind', label: 'label_stock_quality', 'width': 120, 'show-overflow-tooltip': true, formatter: (r, c, v) => this.$enumShow(v, 'StockKindEnum') },

          { key: 'freezeQty', label: 'label_frozen_count', 'width': 120, 'show-overflow-tooltip': true, },

          { key: 'lockQty', label: 'label_lock_count', 'width': 120, 'show-overflow-tooltip': true, },
          { key: 'usableQty', label: 'label_usable_count', 'width': 120, 'show-overflow-tooltip': true, },

          { key: 'totalQty', label: 'label_container_inner_sum_count', 'width': 120, 'show-overflow-tooltip': true, },

          { key: 'putawayOrderNo', label: 'label_putaway_code', 'width': 120, 'show-overflow-tooltip': true, },

          { key: 'putawayTime', label: 'label_putaway_time', 'width': 130, 'show-overflow-tooltip': true, formatter: (r, c, v) => this.$dateFormat(v) },




        ]
      },

    };
  },
  methods: {
  }
};

</script>
<style></style>
